Add universal saving/loading functions based on h5 format#165
Open
cowalz wants to merge 2 commits into
Open
Conversation
Owner
|
Hi @cowalz , Thanks a lot for this PR! There is already a possibility to save simulation results of all In the former Matlab version, I also implemented a way to store the sample structure alone in some kind of XML format. Please feel free to open an issue for this discussion. Best Daniel |
Author
|
Hi Daniel, thanks for your feedback. I will open an Issue related to this PR where we can further discuss this idea: Best Constantin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added to function (save_to_h5 and load_from_h5) to the helpers.py, which should provide a more streamlined data management with unified variable names. The usage of attributes in principle allows saving all relevant parameters of the simulation run as metadata in the h5 file. The h5 format also allows compression, significantly reducing the file size by about 4x to 5x.
A working example is provided in the example.py or .ipynb scripts. The generated h5 files can be read with python or viewed for example with the h5web extension in Visual Studio Code.
I am not sure if there is a convenient way to automatically add all available metadata, like excitation pulse parameters and sample composition to the h5 file, so for now the function only adds the sample structure and composition information as attributes.